package com.example.flasksale.controller;

import com.example.flasksale.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/{productId}")
    public boolean order(@PathVariable Integer productId, @RequestParam Long userId) {
        return orderService.order(productId, userId);
    }

}
